Skip to contentSkip to conversation

Change in openvpn[master]: dco_linux: print meaningful text when netlink message is not parsed

Openvpn-devel In review ordex (Code Review) 2 participants 11 messages May 19, 2025 – May 23, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1747650999000.I568faa12a5960e8b69de23c2df413b70b231592c@...2715...

#1 lore raw

Attention is currently required from: flichtenheld, plaisthos.

Hello plaisthos, flichtenheld,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email

to review the following change.

Change subject: dco_linux: print meaningful text when netlink message is not parsed
......................................................................

dco_linux: print meaningful text when netlink message is not parsed

We may bail out parsing an incoming DCO message because it may concern a different interface.
In that case we print the following debug messages:

dco_do_read
ovpn-dco: ignoring message (type=5) for foreign ifindex 313
process_incoming_dco: received message of type 0 - ignoring

However, the last message is confusing, because there is no message of type 0 being received, but the message_type was simply not initialized.

Fix that by printing something more appropriate like:

process_incoming_dco: received message was not parsed

Change-Id I568faa12a5960e8b69de23c2df413b70b231592c

---
M src/openvpn/dco_linux.c
M src/openvpn/forward.c

2 files changed, 12 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1027/1

src/openvpn/dco_linux.c +6 -0
index 3f7965e..29722cb 100644
@@ -903,6 +903,12 @@
 dco_do_read(dco_context_t *dco)
 {
     msg(D_DCO_DEBUG, __func__);
+
+    /* set the message type to an invalid value so that we later know
+     * if a message was properly parsed or we bailed out earlier
+     */
+    dco->dco_message_type = -1;
+
     nl_cb_set(dco->nl_cb, NL_CB_VALID, NL_CB_CUSTOM, ovpn_handle_msg, dco);
 
     return ovpn_nl_recvmsgs(dco, __func__);
src/openvpn/forward.c +6 -0
index ed4cdb4..39c74af 100644
@@ -1251,6 +1251,12 @@
 
     dco_do_read(dco);
 
+    if (dco->dco_message_type == -1)
+    {
+        msg(D_DCO_DEBUG, "%s: received message was not parsed");
+        return;
+    }
+
     /* FreeBSD currently sends us removal notifcation with the old peer-id in
      * p2p mode with the ping timeout reason, so ignore that one to not shoot
      * ourselves in the foot and removing the just established session */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-MessageType: newchange

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, ordex, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email )

Change subject: dco_linux: print meaningful text when netlink message is not parsed
......................................................................

Patch Set 1: Code-Review-1

(1 comment)

Patchset:

PS1:
%s with no variable...

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 1
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Mon, 19 May 2025 13:03:45 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#3 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, ordex, plaisthos.

Hello cron2, flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email

to look at the new patch set (#2).

The following approvals got outdated and were removed:
Code-Review-1 by cron2

Change subject: dco_linux: avoid bogus text when netlink message is not parsed
......................................................................

dco_linux: avoid bogus text when netlink message is not parsed

We may bail out parsing an incoming DCO message because it may concern a different interface.
In that case we print the following debug messages:

dco_do_read
ovpn-dco: ignoring message (type=5) for foreign ifindex 313
process_incoming_dco: received message of type 0 - ignoring

However, the last message is confusing, because there is no message of type 0 being received, but the message_type was simply not initialized.

Bail out parsing earlier and avoid printing any bogus text.

Change-Id I568faa12a5960e8b69de23c2df413b70b231592c

---
M src/openvpn/forward.c

1 file changed, 6 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1027/2

src/openvpn/forward.c +6 -0
index ed4cdb4..b90a88c 100644
@@ -1251,6 +1251,12 @@
 
     dco_do_read(dco);
 
+    /* no message was parsed - bail out */
+    if (dco->dco_message_type == 0)
+    {
+        return;
+    }
+
     /* FreeBSD currently sends us removal notifcation with the old peer-id in
      * p2p mode with the ping timeout reason, so ignore that one to not shoot
      * ourselves in the foot and removing the just established session */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-MessageType: newpatchset

#4 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

Attention is currently required from: flichtenheld, ordex, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email )

Change subject: dco_linux: avoid bogus text when netlink message is not parsed
......................................................................

Patch Set 2:

(1 comment)

File src/openvpn/forward.c:

http://gerrit.openvpn.net/c/openvpn/+/1027/comment/641ebff7_a3997926 :
PS2, Line 1254: /* no message was parsed - bail out */
I would change this to

```
  /* no message for us to handle - platform specific code has logged details */
```

because we do not really "bail out", we just do nothing because nothing is to be done.

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 2
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 06:09:55 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

#5 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

Attention is currently required from: flichtenheld, ordex, plaisthos.

Hello cron2, flichtenheld, plaisthos,

I'd like you to reexamine a change. Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email

to look at the new patch set (#3).

Change subject: dco_linux: avoid bogus text when netlink message is not parsed
......................................................................

dco_linux: avoid bogus text when netlink message is not parsed

We may bail out parsing an incoming DCO message because it may concern a different interface.
In that case we print the following debug messages:

dco_do_read
ovpn-dco: ignoring message (type=5) for foreign ifindex 313
process_incoming_dco: received message of type 0 - ignoring

However, the last message is confusing, because there is no message of type 0 being received, but the message_type was simply not initialized.

Bail out parsing earlier and avoid printing any bogus text.

Change-Id I568faa12a5960e8b69de23c2df413b70b231592c

---
M src/openvpn/forward.c

1 file changed, 6 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1027/3

src/openvpn/forward.c +6 -0
index ed4cdb4..7134f30 100644
@@ -1251,6 +1251,12 @@
 
     dco_do_read(dco);
 
+    /* no message for us to handle - platform specific code has logged details */
+    if (dco->dco_message_type == 0)
+    {
+        return;
+    }
+
     /* FreeBSD currently sends us removal notifcation with the old peer-id in
      * p2p mode with the ping timeout reason, so ignore that one to not shoot
      * ourselves in the foot and removing the just established session */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 3
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-MessageType: newpatchset

#6 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

Attention is currently required from: cron2, flichtenheld, plaisthos.

ordex has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email )

Change subject: dco_linux: avoid bogus text when netlink message is not parsed
......................................................................

Patch Set 3:

(1 comment)

File src/openvpn/forward.c:

http://gerrit.openvpn.net/c/openvpn/+/1027/comment/40faf5e0_7313db38 :
PS2, Line 1254: /* no message was parsed - bail out */

Quoted 1 line

I would change this to […]

Done

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 3
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: cron2 <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 07:33:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: cron2 <[email protected]...>
Gerrit-MessageType: comment

#7 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

Attention is currently required from: flichtenheld, ordex, plaisthos.

cron2 has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email )

Change subject: dco_linux: avoid bogus text when netlink message is not parsed
......................................................................

Patch Set 3: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 3
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Attention: ordex <[email protected]...>
Gerrit-Comment-Date: Fri, 23 May 2025 07:38:10 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment

#8 lore raw

PATCH v3 1/1 dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

From: Antonio Quartulli <[email protected]...>

We may bail out parsing an incoming DCO message because it may concern a different interface.
In that case we print the following debug messages:

dco_do_read
ovpn-dco: ignoring message (type=5) for foreign ifindex 313
process_incoming_dco: received message of type 0 - ignoring

However, the last message is confusing, because there is no message of type 0 being received, but the message_type was simply not initialized.

Bail out parsing earlier and avoid printing any bogus text.

Change-Id I568faa12a5960e8b69de23c2df413b70b231592c

---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1027
This mail reflects revision 3 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/forward.c +6 -0
index ed4cdb4..7134f30 100644
@@ -1251,6 +1251,12 @@
 
     dco_do_read(dco);
 
+    /* no message for us to handle - platform specific code has logged details */
+    if (dco->dco_message_type == 0)
+    {
+        return;
+    }
+
     /* FreeBSD currently sends us removal notifcation with the old peer-id in
      * p2p mode with the ping timeout reason, so ignore that one to not shoot
      * ourselves in the foot and removing the just established session */
#9 lore raw

[Openvpn-devel] [PATCH applied] Re: dco_linux: avoid bogus text when netlink message is not parsed

"Because it makes sense" :-) - this is one of the messages we can really live without in the log (and *if* there is something to report, the platform specific layer do so).

Your patch has been applied to the master branch.

commit 4a48841da2d4179a96348994f841661ec9e5ce1d

Author: Antonio Quartulli
Date:   Fri May 23 09:38:41 2025 +0200
     dco_linux: avoid bogus text when netlink message is not parsed

     Signed-off-by: Antonio Quartulli <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/[email protected]/msg31763.html
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#10 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

cron2 has uploaded a new patch set (#4) to the change originally created by ordex. ( http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: dco_linux: avoid bogus text when netlink message is not parsed
......................................................................

dco_linux: avoid bogus text when netlink message is not parsed

We may bail out parsing an incoming DCO message because it may concern a different interface.
In that case we print the following debug messages:

dco_do_read
ovpn-dco: ignoring message (type=5) for foreign ifindex 313
process_incoming_dco: received message of type 0 - ignoring

However, the last message is confusing, because there is no message of type 0 being received, but the message_type was simply not initialized.

Bail out parsing earlier and avoid printing any bogus text.

Change-Id I568faa12a5960e8b69de23c2df413b70b231592c

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31763.html

---
M src/openvpn/forward.c

1 file changed, 6 insertions(+), 0 deletions(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/27/1027/4

src/openvpn/forward.c +6 -0
index 022afdb..a83b258 100644
@@ -1251,6 +1251,12 @@
 
     dco_do_read(dco);
 
+    /* no message for us to handle - platform specific code has logged details */
+    if (dco->dco_message_type == 0)
+    {
+        return;
+    }
+
     /* FreeBSD currently sends us removal notifcation with the old peer-id in
      * p2p mode with the ping timeout reason, so ignore that one to not shoot
      * ourselves in the foot and removing the just established session */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: newpatchset

#11 lore raw

[Openvpn-devel] [XS] Change in openvpn[master]: dco_linux: avoid bogus text when netlink message is not parsed

In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email )

Change subject: dco_linux: avoid bogus text when netlink message is not parsed
......................................................................

dco_linux: avoid bogus text when netlink message is not parsed

We may bail out parsing an incoming DCO message because it may concern a different interface.
In that case we print the following debug messages:

dco_do_read
ovpn-dco: ignoring message (type=5) for foreign ifindex 313
process_incoming_dco: received message of type 0 - ignoring

However, the last message is confusing, because there is no message of type 0 being received, but the message_type was simply not initialized.

Bail out parsing earlier and avoid printing any bogus text.

Change-Id I568faa12a5960e8b69de23c2df413b70b231592c

Message-Id: <[email protected]...>
URL: https://www.mail-archive.com/[email protected]/msg31763.html

---
M src/openvpn/forward.c

1 file changed, 6 insertions(+), 0 deletions(-)
src/openvpn/forward.c +6 -0
index 022afdb..a83b258 100644
@@ -1251,6 +1251,12 @@
 
     dco_do_read(dco);
 
+    /* no message for us to handle - platform specific code has logged details */
+    if (dco->dco_message_type == 0)
+    {
+        return;
+    }
+
     /* FreeBSD currently sends us removal notifcation with the old peer-id in
      * p2p mode with the ping timeout reason, so ignore that one to not shoot
      * ourselves in the foot and removing the just established session */

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1027?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings

Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I568faa12a5960e8b69de23c2df413b70b231592c
Gerrit-Change-Number: 1027
Gerrit-PatchSet: 4
Gerrit-Owner: ordex <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: merged